]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
lookingGlass: Only pop modal after the transition
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 9 Jun 2021 23:55:31 +0000 (01:55 +0200)
committerMarge Bot <marge-bot@gnome.org>
Thu, 10 Jun 2021 00:18:00 +0000 (00:18 +0000)
Right now we pop the modal immediately when closing, so the key-release
event of the Escape key ends up in the focus window which may consume it
for leaving fullscreen mode or similar.

We can avoid that in many cases by keeping the modal grab until the end
of the transition, as the key-release event will then likely occur while
the grab is still in place (provided animations are enabled).

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1880>

js/ui/lookingGlass.js

index a9f0512dbaa011298d92011bf0dcc4d5ff82ee58..61d17b7d05548bf512d801647e1760522e4b1861 100644 (file)
@@ -1368,8 +1368,6 @@ class LookingGlass extends St.BoxLayout {
 
         this.setBorderPaintTarget(null);
 
-        Main.popModal(this._entry);
-
         let settings = St.Settings.get();
         let duration = Math.min(LG_ANIMATION_TIME / settings.slow_down_factor,
                                 LG_ANIMATION_TIME);
@@ -1377,7 +1375,10 @@ class LookingGlass extends St.BoxLayout {
             y: this._hiddenY,
             duration,
             mode: Clutter.AnimationMode.EASE_OUT_QUAD,
-            onComplete: () => this.hide(),
+            onComplete: () => {
+                Main.popModal(this._entry);
+                this.hide();
+            },
         });
     }